package cn.lrwjz.androidguide.ui.exmple.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import cn.lrwjz.androidguide.R;

public class StaticFragment extends BaseFragment {
    private TextView tvContent;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_static, container, false);
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        tvContent = view.findViewById(R.id.tv_content);
        tvContent.setText("这是静态Fragment");
    }

    // 提供一个方法供Activity调用，用于更新内容
    public void updateContent(String content) {
        if (tvContent != null) {
            tvContent.setText(content);
        }
    }
} 